package com.study.javaFx.model;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Staff {

    private final IntegerProperty staffId;
    private final StringProperty staffName;
    private final StringProperty role;
    private final StringProperty contact;

    public Staff(Integer staffId, String staffName, String role, String contact) {
        this.staffId = new SimpleIntegerProperty(staffId);
        this.staffName = new SimpleStringProperty(staffName);
        this.role = new SimpleStringProperty(role);
        this.contact = new SimpleStringProperty(contact);
    }

    public Staff() {
        this.staffId = new SimpleIntegerProperty(0);
        this.staffName = new SimpleStringProperty("");
        this.role = new SimpleStringProperty("");
        this.contact = new SimpleStringProperty("");
    }

    // --- Getters and Property Getters ---

    @JsonProperty("staffId")
    public int getStaffId() {
        return staffId.get();
    }

    @JsonProperty("staffId")
    public void setStaffId(int id) {
        this.staffId.set(id);
    }

    public IntegerProperty staffIdProperty() {
        return staffId;
    }

    @JsonProperty("staffName")
    public String getStaffName() {
        return staffName.get();
    }

    @JsonProperty("staffName")
    public void setStaffName(String s) {
        this.staffName.set(s);
    }

    public StringProperty staffNameProperty() {
        return staffName;
    }

    @JsonProperty("role")
    public String getRole() {
        return role.get();
    }

    @JsonProperty("role")
    public void setRole(String s) {
        this.role.set(s);
    }

    public StringProperty roleProperty() {
        return role;
    }

    @JsonProperty("contact")
    public String getContact() {
        return contact.get();
    }

    @JsonProperty("contact")
    public void setContact(String s) {
        this.contact.set(s);
    }

    public StringProperty contactProperty() {
        return contact;
    }
} 